
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{:config('WEB_SITE_TITLE')}后台管理系统</title>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="{$statics}bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="{$css_path}font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="{$css_path}ionicons/css/ionicons.min.css">
  <link rel="stylesheet" href="{$css_path}AdminLTE.min.css">
  <link rel="stylesheet" href="{$css_path}skins/_all-skins.min.css">
  <link rel="stylesheet" href="{$statics}plugins/iCheck/flat/blue.css">
  <link rel="stylesheet" href="{$statics}plugins/morris/morris.css">
  <link rel="stylesheet" href="{$statics}plugins/jvectormap/jquery-jvectormap-1.2.2.css">
  <link rel="stylesheet" href="{$statics}plugins/datepicker/datepicker3.css">
  <link rel="stylesheet" href="{$statics}plugins/daterangepicker/daterangepicker.css">
  <link rel="stylesheet" href="{$statics}plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  <link rel="stylesheet" type="text/css" href="{$statics}layui/css/layui.css">
  <link rel="stylesheet" type="text/css" href="{$statics}plugins/upload/uploadifive.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition skin-green-light sidebar-mini" style="background: #FFF">
<div class="wrapper">
  <header class="main-header">
    <!-- Logo -->
    <a href="Javascript:" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b>S</b>J</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b>{:config('WEB_SITE_TITLE')}</b>管理系统</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
        <ul class="nav navbar-nav">
          <li><a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"><span class="sr-only">切换导航</span></a></li>              
        </ul>
      </div>
      <div class="navbar-custom-menu"> 
        <ul class="nav navbar-nav">
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img src="{$img_path}user2-160x160.jpg" class="user-image" alt="User Image">
              <span class="hidden-xs">{$uinfo.username}</span>
            </a>
            <ul class="dropdown-menu">
              <!-- User image -->
              <li class="user-header">
                <img src="{$img_path}user2-160x160.jpg" class="img-circle" alt="User Image">

                <p>{$uinfo.username}<small>{$uinfo.rolename}</small></p>
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                <div class="pull-left">
                  <a href="{:url('adminuser/edit_pwd')}" class="btn btn-default btn-flat cocoModal" isForm >修改密码</a>
                </div>
                <div class="pull-right">
                  <a href="{:url('login/logout')}" class="btn btn-default btn-flat">登出</a>
                </div>
              </li>
            </ul>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->

      <!-- search form -->
      
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" id="slidebar-menu">
        <li class="header">导航菜单</li>
        {volist name="menus" id="vss" key="keys"}
        <li class="treeview">
          {eq name="vss.ischild" value="1"}
          <a href="Javascript:">
          {else}
          <a href="Javascript:" class="site-demo-active" data-type="tabAdd" title="{$vss.title}" url="{:url($vss['url'])}" menuid="{$vss['id']}">
          {/eq}
            <i class="fa {$vss.icon}"></i> <span>{$vss.title}</span>
            {eq name="vss.ischild" value="1"}
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
            {/eq}
          </a>
          {eq name="vss.ischild" value="1"}
          <ul class="treeview-menu">
            {volist name="vss.child" id="vs"}
            <li {eq name='$vs.active' value='1'}class="active"{/eq}><a href="Javascript:" class="site-demo-active" data-type="tabAdd" title="{$vs.title}" url="{:url($vs['url'])}" menuid="{$vs['id']}"><i class="fa fa-circle-o"></i> {$vs.title}</a></li>
            {/volist}
          </ul>
          {/eq}
        </li>
        {/volist}
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" style="background: #FFF;" id="contentw">
    <div class="layui-tab layui-tab-card" lay-filter="demo" lay-allowclose="true" style="margin:0">
      <ul class="layui-tab-title">
        <li class="layui-this" lay-id="1"><i class="fa fa-sticky-note-o"></i> 首页</li>
      </ul>
      <div class="layui-tab-content" style="padding:0">
        <div class="layui-tab-item layui-show">
          <iframe class="larry-iframe" style="width:100%;" frameborder="0" scrolling="auto" data-id='0' name="ifr_0" id='ifr0'  src="{:url('main')}"></iframe>
        </div>
      </div>
    </div>
  </div>
  <!-- /.content-wrapper -->
  <footer class="main-footer" style="padding:5px">
    <div class="pull-right hidden-xs">
      <b>Version</b> 1.0.0
    </div>
    <!-- <strong>版权所有：椰果网络科技(www.coco3g.com)</strong>  -->
  </footer>
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<script src="{$statics}plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="{$js_path}jquery-ui.min.js"></script>
<script src="{$statics}bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{$statics}layui/layui.js"></script>
<script src="{$statics}plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="{$js_path}app.min.js"></script>
<script type="text/javascript" src="{$statics}admin.js"></script>
<script type="text/javascript">
  var wheight = $(window).height();
  function show_child_menu(obj,datajson){
    $('#slidebar-menu').html(datajson.content);
  }
  $(function(){
    $('.larry-iframe').height(wheight); 
    $('#contentw').css("max-height",wheight - 100 + 19);
    $('#contentw').css("min-height",0);
  })
  // window.onresize=function(){   
  //     wheight = $(window).height();
  //     $('.larry-iframe').height(wheight); 
  //     $('#contentw').css("max-height",wheight - 100 + 19);
  //     $('#contentw').css("min-height",0);
  //     $('.larry-iframe').each(function(){
  //       src = $(this).attr("src");
  //       if(src.indexOf("?") != -1){
  //         src += '&'+Math.random();
  //       }
  //       else{
  //         src += '?'+Math.random();
  //       }
  //       $(this).attr('src', src);
  //     })
  // }
</script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
  
  //触发事件
  var active = {
    tabAdd: function(){
      //新增一个Tab项
      title = $(this).attr("title");
      url = $(this).attr("url");
      menuid = $(this).attr("menuid");
      if($("li[lay-id='"+menuid+"']").html() != undefined){
        element.tabChange('demo', menuid);
        return false;
      }
      element.tabAdd('demo', {
        title: '<i class="fa fa-sticky-note-o"></i> '+title //用于演示
        ,content: '<iframe class="larry-iframe" style="width:100%;height:'+(wheight - 120)+'px" frameborder="0" scrolling="auto" src="'+url+'"></iframe>'
        ,id: menuid
      });
      element.tabChange('demo', menuid); //切换到：用户管理
    }
    ,tabDelete: function(othis){
      //删除指定Tab项
      element.tabDelete('demo', '44'); //删除：“商品管理”
      
      
      othis.addClass('layui-btn-disabled');
    }
    ,tabChange: function(){
      //切换到指定Tab项
      element.tabChange('demo', '22'); //切换到：用户管理
    }
  };
  
  $('.site-demo-active').on('click', function(){
    var othis = $(this), type = othis.data('type');
    active[type] ? active[type].call(this, othis) : '';
  });
  
});
</script>
</body>
</html>